package com.midea.mgc.mgcaigc.impl;

import com.midea.mgc.mgcaigc.entity.AjaxMessageEntity;
import com.midea.mgc.mgcaigc.service.InteractionService;
import com.midea.mgc.mgcaigc.util.SignUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service("interactionService")
public class InteractionServiceImpl implements InteractionService {

    @Autowired
    private SignUtil signUtil;

    @Override
    public AjaxMessageEntity query(String ask) {
        Long currentTime = new Date().getTime();
        try {
            //1.获取sign
            String sign = signUtil.getSign(currentTime);
            System.out.println(sign);
            //2.用appKey、currentTime、sign去获取accessToken

        } catch (Exception e) {
            throw new RuntimeException(e);
        }


        return null;
    }
}
